package ah.generic;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;

public class ListT {

	
	
	
	/**
	 * 泛型
	 * @param args
	 * @author ddh
	 */
	public static void main(String[] args) {
		//List<String> list = new ArrayList();//error
		ArrayList<String> list2 = new ArrayList();
		ArrayList list3 = new ArrayList<Date>();
		//ArrayList<Object> list4 = new ArrayList<String>();
		
		//list2.add(new Date());
		list3.add("Hello");
		
		List<String> aList = new ArrayList<String>();
		List bList = aList;
		bList.add(2);
		//aList.add(2);//error
		
		Collection<?> c = new ArrayList<Object>();
//		c.add("asdf");
//		c.add(new Object());
//		c.add(2);
		c.add(null);
		c.addAll(null);
	}
	
	public <T> T test() {
		Object obj = new List<?>[3];
		return null;
	}

}
